
$.validator.addMethod("atleastonerequire", function (value, element, param) {
    var grouped = $("[data-val-atleastonerequire-group='" + param + "']");
    for (var i = 0; i < grouped.length; i++) {
        if ($(grouped[i]).val()) {
            return true;
        }
    }
    return false;
});

$.validator.unobtrusive.adapters.add("atleastonerequire", ["group"], function (options) {
    options.rules["atleastonerequire"] = options.params.group;
    options.messages["atleastonerequire"] = options.message;
});

